package com.valkyries.jhhj.service.impl;

import com.mybatisflex.core.query.QueryWrapper;
import com.valkyries.jhhj.domain.Role;
import com.valkyries.jhhj.mapper.RoleMapper;
import com.valkyries.jhhj.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import static com.valkyries.jhhj.domain.table.Tables.ROLE;

/**
 * 角色Service业务层处理
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;

    /**
     * 查询列表中包含的所有角色id的数据
     */
    @Override
    public List<Role> queryListByIds(List<Long> roleIds) {
        return roleMapper.selectListByQuery(new QueryWrapper()
                .where(ROLE.ROLE_ID.in(roleIds))
        );
    }
}
